package d0325;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Properties;

public class TestMessageFormat {
    public static void main(String[] args) throws IOException {
      //  String pattern="{0}您好,应付金额是{1}";

            FileReader fr=new FileReader(new File("src/d0325/message.properties"));

        Properties properties=new Properties();
        properties.load(fr);
        String  pattern=properties.getProperty("pattern");

        System.out.println(MessageFormat.format(pattern,new Object[]{"Alice",123}));
        System.out.println(MessageFormat.format(pattern,new Object[]{"Lily",145}));

    }

}
